<div class="layui-form" id="layuiadmin-form-admin" lay-filter="layuiadmin-form-admin" style="padding: 20px 30px 0 0;">
    <div class="layui-row">
        <div class="layui-col-xs12 layui-col-sm6 layui-col-md6">
            <div class="layui-form-item">
                <label class="layui-form-label">
                    月份
                </label>
                <div class="layui-input-block">
                    <input autocomplete="off" class="layui-input" name="month" id="month" placeholder="请输入月份"
                           required=""
                           type="text"/>
                </div>
            </div>
        </div>
        <div class="layui-col-xs12 layui-col-sm6 layui-col-md6">
            <div class="layui-form-item">
                <label class="layui-form-label">
                    实发工资
                </label>
                <div class="layui-input-block">
                    <input autocomplete="off" class="layui-input" name="real_salary" placeholder="请输入实发工资" required=""
                           type="text"/>
                </div>
            </div>
        </div>
    </div>
    <div class="layui-row">

        <div class="layui-col-xs12 layui-col-sm6 layui-col-md6">
            <div class="layui-form-item">
                <label class="layui-form-label">
                    人员姓名
                </label>
                <div class="layui-input-block">
                    <select name="admin_id" lay-search="">
                        <option value="">请选择人员名称</option>
                        {foreach $admin as $key=>$vo}
                        <option value="{$vo.id}">{$vo.nickname}</option>
                        {/foreach}
                    </select>
                </div>
            </div>
        </div>
        <div class="layui-col-xs12 layui-col-sm6 layui-col-md6">
            <div class="layui-form-item">
                <label class="layui-form-label">
                    所属部门
                </label>
                <div class="layui-input-block">
                    <select name="group_id" lay-search="">
                        <option value="">请选择部门</option>
                        {foreach $dept as $key=>$vo}
                        <option value="{$vo.id}">{$vo.name}</option>
                        {/foreach}
                    </select>
                </div>
            </div>
        </div>
    </div>
    <div class="layui-row">
        <div class="layui-col-xs12 layui-col-sm6 layui-col-md6">
            <div class="layui-form-item">
                <label class="layui-form-label">
                    基本工资
                </label>
                <div class="layui-input-block">
                    <input autocomplete="off" class="layui-input" name="basic_salary" placeholder="请输入基本工资" required=""
                           type="text"/>
                </div>
            </div>
        </div>
        <div class="layui-col-xs12 layui-col-sm6 layui-col-md6">
            <div class="layui-form-item">
                <label class="layui-form-label">
                    岗位工资
                </label>
                <div class="layui-input-block">
                    <input autocomplete="off" class="layui-input" name="post_salary" placeholder="请输入岗位工资" required=""
                           type="text"/>
                </div>
            </div>
        </div>
        <div class="layui-form-item layui-inline">
            <label class="layui-form-label">
                绩效工资
            </label>
            <div class="layui-input-inline">
                <select id="achievements_status">
                    <option value="1">增</option>
                    <option value="2">减</option>
                </select>

            </div>
            <div class="layui-input-inline">
                <input autocomplete="off" class="layui-input" name="achievements_salary" id="birthday"
                       placeholder="请输入绩效工资" required="" type="text"/>
            </div>
        </div>
        <div class="layui-col-xs12 layui-col-sm6 layui-col-md6">
            <div class="layui-form-item">
                <label class="layui-form-label">
                    保密津贴
                </label>
                <div class="layui-input-block">
                    <input autocomplete="off" class="layui-input" name="secrecy" placeholder="请输入保密津贴" required=""
                           type="text"/>
                </div>
            </div>
        </div>
        <div class="layui-col-xs12 layui-col-sm6 layui-col-md6">
            <div class="layui-form-item">
                <label class="layui-form-label">
                    工资总额
                </label>
                <div class="layui-input-block">
                    <input autocomplete="off" class="layui-input" name="total_salary" placeholder="请输入工资总额" required=""
                           type="text"/>
                </div>
            </div>
        </div>
        <div class="layui-col-xs12 layui-col-sm6 layui-col-md6">
            <div class="layui-form-item">
                <label class="layui-form-label">
                    缺勤天数
                </label>
                <div class="layui-input-block">
                    <input autocomplete="off" class="layui-input" name="absence_duty_day" placeholder="请输入缺勤天数"
                           required=""
                           type="text"/>
                </div>
            </div>
        </div>
        <div class="layui-col-xs12 layui-col-sm6 layui-col-md6">
            <div class="layui-form-item">
                <label class="layui-form-label">
                    奖金
                </label>
                <div class="layui-input-block">
                    <input autocomplete="off" class="layui-input" name="bonus" placeholder="请输入奖金" required=""
                           type="text"/>

                </div>
            </div>
        </div>
        <div class="layui-col-xs12 layui-col-sm6 layui-col-md6">
            <div class="layui-form-item">
                <label class="layui-form-label">
                    补助
                </label>
                <div class="layui-input-block">
                    <input autocomplete="off" class="layui-input" name="subsidy" placeholder="请输入补助" required=""
                           type="text"/>
                </div>
            </div>
        </div>
        <div class="layui-col-xs12 layui-col-sm6 layui-col-md6">
            <div class="layui-form-item">
                <label class="layui-form-label">
                    绩效
                </label>
                <div class="layui-input-block">
                    <input autocomplete="off" class="layui-input" name="achievements" placeholder="请输入绩效" required=""
                           type="text"/>
                </div>
            </div>
        </div>
        <div class="layui-col-xs12 layui-col-sm6 layui-col-md6">
            <div class="layui-form-item">
                <label class="layui-form-label">
                    其他
                </label>
                <div class="layui-input-block">
                    <input autocomplete="off" class="layui-input" name="other" placeholder="请输入其他扣除项" required=""
                           type="text"/>
                </div>
            </div>
        </div>
        <div class="layui-col-xs12 layui-col-sm6 layui-col-md6">
            <div class="layui-form-item">
                <label class="layui-form-label">
                    降薪工资
                </label>
                <div class="layui-input-block">
                    <input autocomplete="off" class="layui-input" name="pay_cut" placeholder="请输入降薪工资" required=""
                           type="text"/>
                </div>
            </div>
        </div>
        <div class="layui-col-xs12 layui-col-sm6 layui-col-md6">
            <div class="layui-form-item">
                <label class="layui-form-label">
                    应发工资
                </label>
                <div class="layui-input-block">
                    <input autocomplete="off" class="layui-input" name="should_salary" placeholder="请输入应发工资" required=""
                           type="text"/>
                </div>
            </div>
        </div>
        <div class="layui-col-xs12 layui-col-sm6 layui-col-md6">
            <div class="layui-form-item">
                <label class="layui-form-label">
                    社保
                </label>
                <div class="layui-input-block">
                    <input autocomplete="off" class="layui-input" name="social_insurance" placeholder="请输入社保"
                           required=""
                           type="text"/>
                </div>
            </div>
        </div>
        <div class="layui-col-xs12 layui-col-sm6 layui-col-md6">
            <div class="layui-form-item">
                <label class="layui-form-label">
                    个税
                </label>
                <div class="layui-input-block">
                    <input autocomplete="off" class="layui-input" name="tax" placeholder="请输入个税" required=""
                           type="text"/>
                </div>
            </div>
        </div>
        <div class="layui-col-xs12 layui-col-sm12 layui-col-md12">
            <div class="layui-form-item">
                <label class="layui-form-label">
                    备注
                </label>
                <div class="layui-input-block">
                    <input autocomplete="off" class="layui-input" name="remarks" placeholder="请输入备注" required=""
                           type="text"/>
                </div>
            </div>
        </div>
    </div>
    <div class="layui-form-item layui-hide">
        <input id="LAY-user-back-submit" lay-filter="LAY-user-back-submit" lay-submit="" type="button" value="确认">
        </input>
    </div>
</div>
<script src="/static/admin/layui/layui.js">
</script>
<script>
    layui.config({
        base: '/static/admin/' //静态资源所在路径
    }).extend({
        index: 'lib/index', //主入口模块
        treeTable: '../admin/lib/extend/authtree'
    }).use(['index', 'form', 'laydate', 'upload'], function () {
        var $ = layui.$, form = layui.form, laydate = layui.laydate, upload = layui.upload;
        laydate.render({
            elem: '#month'
            , type: 'month'
            , trigger: 'click'
            , value: new Date()

        });

//多文件列表示例
        var j = 0;
        var demoListView = $('#demoList')
            , uploadListIns = upload.render({
            elem: '#testList'
            , url: "{:url('customer/upload')}"
            , accept: 'file'
            , multiple: true
            , auto: false
            , bindAction: '#testListAction'
            , choose: function (obj) {
                var files = this.files = obj.pushFile(); //将每次选择的文件追加到文件队列
                //读取本地文件
                obj.preview(function (index, file, result) {
                    var tr = $(['<tr id="upload-' + index + '">'
                        , '<td>' + file.name + '</td>'
                        , '<td>' + (file.size / 1014).toFixed(1) + 'kb</td>'
                        , '<td>等待上传</td>'
                        , '<td>'
                        , '<button class="layui-btn layui-btn-xs demo-reload layui-hide">重传</button>'
                        , '<button class="layui-btn layui-btn-xs layui-btn-danger demo-delete">删除</button>'
                        , '</td>'
                        , '</tr>'].join(''));

                    //单个重传
                    tr.find('.demo-reload').on('click', function () {
                        obj.upload(index, file);
                    });

                    //删除
                    tr.find('.demo-delete').on('click', function () {
                        delete files[index]; //删除对应的文件
                        tr.remove();
                        uploadListIns.config.elem.next()[0].value = ''; //清空 input file 值，以免删除后出现同名文件不可选
                    });

                    demoListView.append(tr);
                });
            }
            , done: function (res, index, upload) {
                if (res.code == 0) { //上传成功
                    var tr = demoListView.find('tr#upload-' + index)
                        , tds = tr.children();
                    tds.eq(2).html('<span style="color: #5FB878;">上传成功</span>');
                    tds.eq(3).html(''); //清空操作
                    $('#layui-file').append('<input type="hidden" name="pc_src[' + j + ']" value="' + res.data['src'] + '" />');
                    $('#layui-file').append('<input type="hidden" name="pc_name[' + j + ']" value="' + res.data['name'] + '" />');
                    j++;
                    return delete this.files[index]; //删除文件队列已经上传成功的文件

                }
                this.error(index, upload);
            }
            , error: function (index, upload) {
                var tr = demoListView.find('tr#upload-' + index)
                    , tds = tr.children();
                tds.eq(2).html('<span style="color: #FF5722;">上传失败</span>');
                tds.eq(3).find('.demo-reload').removeClass('layui-hide'); //显示重传
            }
        });
    });
</script>